package com.zcx.qshop.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;

import com.zcx.qshop.R;

/**
 * Created by Administrator on 2015/9/25 0025.
 */
public class LoadLoadingView extends ImageView {

    private AlphaAnimation alphaAnimation;

    public LoadLoadingView(Context context, AttributeSet attrs) {

        super(context, attrs);

        setBackgroundResource(R.mipmap.load_loading);

        alphaAnimation = new AlphaAnimation(0, 1);

        alphaAnimation.setDuration(1500);

    }

    public void startNow(){

        setAnimation(alphaAnimation);

        alphaAnimation.startNow();

    }

    public void cancel(){

        alphaAnimation.cancel();

    }

}
